package com.example.usercenter.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;

/**
 * 自定义 Swagger 接口文档的配置
 * @author Hedon Wang
 * @create 2020-06-23 20:23
 */

@Profile({"dev","test"})
public class SwaggerConfig {

    @Bean
    public OpenAPI springShopOpenAPI(){
        return new OpenAPI()
                .info(new Info()
                        .title("设备管理系统接口文档")
                        .description("")
                        .version("v1.0")
                        .contact(new Contact()
                                .name("")
                                .email("")
                        )
                )
                .externalDocs(new ExternalDocumentation()
                        .description("点击这里查看API文档说明")
                        .url("http://127.0.0.1:8888")
                );
    }

}
